package com.yunhui.config;




import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id ="2016092700606392";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDISN/AXvrQnX9DL4gIX4AhxqjsV36FGVVBNzXrXiP2kTiRmfjW9EbUDBUFJUg4PPSnMVmVQhzCvrVr4BgLyY/zIUipN7Gi6RlwmcPM+fczJ3tOVz+Haob2w8iIOxtgDwSQrHQKk8xbxqINgvAajlR7pFOYXenk6y06MiJ38Igq0QfEAUrKE7es4JOQZD+aDZlrfrxOgETecbRh2e2f3BJT/gsv2TSS3Fr89czVACQVwdpL/6XE9qFmkkVS44aWB6+gnNiW+oSK3ajP9vzARXMTWn0Yxj4zb70Ofu2nfohmGQFPVmlUQzOb3xAv+GjBhg2Us+JvklnZ0bWtFeQTXLXNAgMBAAECggEBAKt0Lw94f5As86/pNbOtRXwkm6FPOUDpseEVSXRG79R49ws12x7wmN2XxjrUcqGqFOo3xe+PXB2esqI5gXw9vZwt5wztX4UNtTh+eW60odjJuLYU3I6pNAZ1DesJZmLyGD9dUi1n3u7F+R5F9BNXupzpzKJH6x2L8fi6yGUSpQ64w/qGg6HNyMxKAUrsl0H6i+bKK/tLyEhKd7mbZE+pkAwXwtfq2eJevtOet5xmiOBJj+zIbUWI5SJF9qMvttjK1r1ezQ2QHiV1ojQUbqew6hWp4MuWy5hdlOkPPWKgADiFiOCD4di4XdmDjCCndNN2uUaK+kK9oz3T0yKjmUaEmOUCgYEA9CjjcZX53cJEAYUA4RK36D1VfIXcl6uxq+kmhCTLesT/RhAa76Hpq4DDjpJomd3iGcRVfb+RwtiORER/sgDlOfcR0JTy7EhrXgjUUm9V4Uc01N5Gu8B+dUR0QEsjeAC8+ltih5uxEg0HRdDe6kw7BJ8lCeteSsirdIlvpPTuyfcCgYEA0f9M5IOKog9bzymACuPiFDqFpakXc6rKgn7wHnkpoExhW/hlx30YHXwNZUhdEDeZJt0S7+Qu+OfPqXV8T5mFaBhtTRmJo1ctZXfnjpOvlUWXq++l3ZhLcduEd5cvZ9buFDjWXJ55TjngnMytoE11uS/fV9qRgol8SmjDKbQ5rVsCgYEA567VBDd4PoHU3kxDJVAJywpIUD0FsbZuhd5behEgNIMyaF1n8fQGM4OgDW3IbBksL58qMITT37x2YzlMorBO084qzW5JhQTDPRvLvd1/9KEI9OVm4UortUMbvNaP9ZNdv4Nv35ZRU/ug5xLoNBPZ/Oy2zM7XTsdUSuUPV8xDuskCgYB1v/3RtKCrtoj4ZIDTmmxOg3IlLedkiEP9YEgsDix1Id8FvwbzEQXQopqwTB9C1KofzJ6tvPlJwFIE50fJKoBPmkLPlJ5E5MEjwFQq8kzmGputYTdURe0n7rscg72lMDNXS3eHf6TtZC66PVquJED6kgleLcShuY3j+1JTtCcTOQKBgQDa6EHV/RI3sdAaxJfLLWH5IIm2s+klqj9HMS3C8kdQjFRADAOGyFQhukafmX1wcV7VUFkCgqNwGFpThKgPZZYc7nVbpB9OhN/+mpu7RogwW6CJxBPXitJxMgebldCx54fJNmVgp7JjJoqy+TUbxvRVL0Zg5tYDfz8B71yFHRRlTQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3ofOOt1XOV4Vz6SUsdTXQzPlFqapaCvNGE8f5DqkRnqhPvma3rWUb4RPzdlYdBDr+zXxkoVkmiFTla83jBf5sPGeplwT+J9porl+GjNQxBjZU9QbgF121o3yWDGxHLxp1YhUncPw0xgE4aEfvC6kTREZ20e+NtHNy9QogWHq8NywI9mEL49kd/y99CwGhEywVxhyV48WGUjZ9MLs3OE+ImVoORcnqApFoWDQH/VpzGhk8JrcFrR/7y0bNn+vd5/6crm6EmimRsNVGn+aKX8JEHqZ77cimWoEJjg1+3j71kBSFjeJcIpd/s/AadP0miD3ckbaXt2xQZYB3mxu5Re0UQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/order/myorder";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问  return_url.jsp
    public static String return_url ="http://localhost:8080/order/myorder";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}

